package com.whpost.api.controller.stamp;

import cn.dev33.satoken.stp.StpUtil;
import com.whpost.api.controller.BaseController;
import com.whpost.api.utils.ApiUtils;
import com.whpost.service.entity.tools.ResultInfo;
import com.whpost.service.service.stamp.StampCardOrderServices;
import com.whpost.service.service.stamp.StampHdServices;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/stamp/order")
public class StampCardOrderController extends BaseController {

    @Resource
    StampCardOrderServices stampCardOrderServices;

    @Autowired
    public StampCardOrderController(StampCardOrderServices stampCardOrderServices) {
        super();
        setPerCode("stamporder");
        setBaseServices(stampCardOrderServices);

    }


    /**
     * 退款
     * @return
     */
    @RequestMapping(value ="/tk")
    public ResultInfo tk(@RequestBody Map<String, Object> map){
        StpUtil.checkPermission("wx:tk");
        String loginId = ApiUtils.getLoginId();
        return stampCardOrderServices.tk(loginId,map);
    }

    /**
     * 发货登记
     * @return
     */
    @RequestMapping(value ="/fhdj")
    public ResultInfo fhdj(@RequestBody Map<String, Object> map){
        StpUtil.checkPermission("stamporder:fhdj");
        String loginId = ApiUtils.getLoginId();
        return stampCardOrderServices.fhdj(loginId,map);
    }
}
